package com.shop2cn.iapi.agentproducts.testcase;

import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.agentproducts.parameter.AddAgentProductBean;
import com.shop2cn.iapi.agentproducts.parameter.RebateConditionSelectorBean;
import com.shop2cn.iapi.agentproducts.service.RebateConditionSelectorCall;
import com.ymatou.iapi.godmch.parameter.createDepotBean;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.AddAgentProductCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.godmch.mch_depot_info;
/**
*条件筛选器Test
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_RebateConditionSelector{
	private static RebateConditionSelectorBean rebateconditionselectorBean;
	private static RebateConditionSelectorCall rebateconditionselectorCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("条件筛选器Test");
	}

	@Before
	public void caseUp() {
		rebateconditionselectorBean=new RebateConditionSelectorBean();
		rebateconditionselectorCall=new RebateConditionSelectorCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(rebateconditionselectorCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	private int userId=501151100;
	private int brandId=21488;
	private int firstCategoryId=1003;
	private int depotId=102857;
	
	//0：品牌   3：仓库   5：一级类目    10：品牌+仓库+一级类目
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_RebateConditionSelector_001() {
		Logger.start(true,"根据品牌进行筛选，成功");
		try {
			rebateconditionselectorBean.setUserId(userId);
			rebateconditionselectorBean.setBrandId(brandId);
			rebateconditionselectorBean.setSearchType(0);
			rebateconditionselectorCall.setData(rebateconditionselectorBean);
			rebateconditionselectorCall.callService();			
			Logger.verifyEquals("200", rebateconditionselectorCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_RebateConditionSelector_002() {
		Logger.start(true,"根据品牌，品类，仓库进行筛选，成功");
		try {
			rebateconditionselectorBean.setUserId(userId);
			rebateconditionselectorBean.setBrandId(brandId);
			rebateconditionselectorBean.setFirstCategoryId(firstCategoryId);
			rebateconditionselectorBean.setDepotId(depotId);
			rebateconditionselectorBean.setSearchType(10);
			rebateconditionselectorCall.setData(rebateconditionselectorBean);
			rebateconditionselectorCall.callService();			
			Logger.verifyEquals("200", rebateconditionselectorCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
}